package com.huilian.iotbox.admin.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.huilian.iotbox.admin.dao.MoneyDetailsDao;
import com.huilian.iotbox.admin.service.MoneyDetailsService;
import com.huilian.iotbox.data.dto.MoneyDetailsDto;
import com.huilian.iotbox.data.vo.MoneyDetailsVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 谢洛涛
 * @date 2021/9/19 11:06
 */
@Service
public class MoneyDetailsServiceImpl implements MoneyDetailsService {
    @Resource
    private MoneyDetailsDao moneyDetailsDao;
    @Override
    public Integer insert(MoneyDetailsDto moneyDetailsDto) {
        return moneyDetailsDao.insert(moneyDetailsDto);
    }

    @Override
    public PageInfo findList(MoneyDetailsDto moneyDetailsDto) {
        PageHelper.startPage(moneyDetailsDto.getPageNum(),moneyDetailsDto.getPageSize());
        List<MoneyDetailsVo> list = moneyDetailsDao.findList(moneyDetailsDto);
        PageInfo pageInfo = new PageInfo(list);
        return pageInfo;
    }
}
